@extends('layouts.appManager')

@section('script')
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                list:[],
                list_total:0,
                search:{
                    page:1,
                    size:10
                },
                curItem:null,
            },
            created: function () {
                console.log(this.a)
            },
            mounted() {
                this.getList();
            },
            methods: {
                getList(){
                    let t=this;
                    post("getLogs",t.search,res=>{
                        t.list=res.data.data
                        t.list_total=res.data.total
                        console.log(res)
                    },t);
                },
                examine(item){
                    let t=this;
                    post("examine", {id:item.id},res=>{
                        if(res.err===0){
                            item.state=1
                        }
                        console.log(res)
                    },t);
                },
                handleCurrentChange(page){
                    this.search.page=page;
                    this.getList();
                }
            }
        })
    </script>
@endsection

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-12">
        	<h4 class="text-center mb-2">提现列表</h4>
            <div class="table-responsive">
            <el-table
                :data="list"
                style="width: 100%;font-size: 13px">
                <el-table-column
                    prop="order_num"
                    label="order_num"
                    width="180">
                </el-table-column>
                <el-table-column
                    label="客户">
                    <template slot-scope="scope">
                        @{{scope.row.user.name}}
                    </template>
                </el-table-column>
                <el-table-column width="80"
                    prop="money"
                    label="金额">
                </el-table-column>
                <el-table-column width="80"
                    prop="cash_fee"
                    label="手续费">
                </el-table-column>
                <el-table-column width="80"
                    prop="real_money"
                    label="实到金额">
                </el-table-column>
                <el-table-column
                    prop="created_at"
                    label="时间">
                </el-table-column>
                <el-table-column
                    label="收款账户">
                    <template slot-scope="scope">
                        @{{scope.row.alipay_account}} <br>
                        @{{scope.row.alipay_name}}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="state"  width="100"
                    label="状态">
                    <template slot-scope="scope">
                        <div v-if="scope.row.state===1">已转账</div>
                        <el-button v-else type="primary" @click="examine(scope.row)" size="mini">待审核</el-button>
                    </template>
                </el-table-column>
            </el-table>
            </div>
            <div style="text-align: center; margin-top: 15px">
                <el-pagination background
                    @current-change="handleCurrentChange"
                    layout="prev, pager, next"
                    :total="list_total">
                </el-pagination>
            </div>


        </div>
    </div>
</div>

@endsection
